import Vue from 'vue'
import VueRouter from 'vue-router'
import Welcome from '../views/Welcome'
import Home from '../views/Home'
import KMap from '../views/KMap'
import videoAndPdf from '../views/videoAndPdf'
import EditPage from "../views/EditPage"
import Upload from "../views/Upload"
import Comment from "../views/Comment"
import Post from "../views/Post"
import Degree from "../views/degree.vue"
import Manager from "../views/Manager"
import search from "../views/search"
import UserInfo from "../views/UserInfo"
import control from "../views/control"
import mid from "../views/mid"

Vue.use(VueRouter)

const routes = [
    {
        path:'/mid',
        name:'mid',
        component:mid,
    },
    {
        path:'/control',
        name:'control',
        component:control,
    },
    {
        path: '/search',
        name: 'Search',
        component: search,
    },
    {
        path: '/manager',
        name: 'Manager',
        component: Manager,
    },
    {
        path: '/post',
        name: 'Post',
        component: Post,
    },
    {
        path: '/comment',
        name: 'Comment',
        component: Comment,
    },
    {
        path: '/',
        name: 'Welcome',
        component: Welcome,
    },
    {
        path: '/upload',
        name: 'Upload',
        component: Upload,
    },
    {
        path: '/degree',
        name: 'degree',
        component: Degree,
    },
    {
        path: '/EditPage',
        name: 'EditPage',
        component: EditPage,
    },
    {
        path: '/UserInfo',
        name: 'UserInfo',
        component: UserInfo,
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        redirect: '/KMap',
        children: [
            {
                path: '/videoAndPdf',
                name: 'videoAndPdf',
                component: videoAndPdf,
            },
            {
                path: '/KMap',
                name: 'KMap',
                component: KMap,
            },
        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
